import request from '@/utils/request'

export function allRoleList(data) {
  return request({
    url: '/api/sysRole/allRoleList',
    method: 'get',
    data
  })
}

export function getAllRoleList(params) {
  return request({
    url: '/api/sysRole/list/all',
    method: 'post',
    data: params
  })
}

export function getRoleById(id) {
  return request({
    url: '/api/sysRole/detail',
    method: 'get',
    params: { 'id': id }
  })
}

export function deleteRoleById(id) {
  return request({
    url: '/api/sysRole/delete',
    method: 'get',
    params: { 'id': id }
  })
}

export function updateRole(params) {
  return request({
    url: '/api/sysRole/edit',
    method: 'post',
    data: params
  })
}

export function addRole(params) {
  return request({
    url: '/api/sysRole/add',
    method: 'post',
    data: params
  })
}
